<?php 
namespace App\Http\Controllers\User;

use App\Http\Controllers\Controller;
use App\Ext\Parsedown;
use App\Model\Article;
use Session;

class WordController extends Controller
{
	public function __construct()
    	{
		$this->middleware('loadnav');
	}
	
	public function show($id)
	{
		$Article = Article::Get_Article($id);
		if(!isset($Article)) {
			return response()->view('errors.503', [], 404);
		} else {
			Article::Add_Click($id);
			$Parsedown = new Parsedown();
			$Article->body = $Parsedown->text($Article->body);
		}
		return view('user.Word', ['Article' => $Article]);
	}
}